package com.xilihui.xlh.business.requests;

import com.xilihui.xlh.business.entities.AddOrderEntity;
import com.xilihui.xlh.business.entities.AppointmentEntity;
import com.xilihui.xlh.business.entities.BalanceEntity;
import com.xilihui.xlh.business.entities.CartListEntity;
import com.xilihui.xlh.business.entities.CheckEntity;
import com.xilihui.xlh.business.entities.EvaluateEntity;
import com.xilihui.xlh.business.entities.GoodDetailsEntity;
import com.xilihui.xlh.business.entities.HistoryEntity;
import com.xilihui.xlh.business.entities.MyOrderEntity;
import com.xilihui.xlh.business.entities.PayingEntity;
import com.xilihui.xlh.business.entities.ShopDetailEntity;
import com.xilihui.xlh.business.entities.SpecEntity;
import com.xilihui.xlh.business.entities.TakeCodeEntity;
import com.xilihui.xlh.business.entities.TakeGoodsEntity;
import com.xilihui.xlh.core.app.BaseEntity;

import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
import rx.Observable;

/**
 * Created by Administrator on 2018/6/25.
 */

public interface MyAppointmentService {
    
    //我的预约
    @GET("/api/appoint/my_appoint")
    Observable<AppointmentEntity> myAppoint(
            @Query("access_token") String access_token,
            @Query("status") int status,
            @Query("page") int page
    );
    
    //历史记录
    @GET("/api/appoint/history")
    Observable<HistoryEntity> history(
            @Query("access_token") String access_token,
            @Query("status") int status,
            @Query("page") int page
    );
    
    //我的预约-提交评价
    @FormUrlEncoded
    @POST("/api/appoint/comment_store")
    Observable<BaseEntity> submitComment(
            @Field("access_token") String access_token,
            @Field("agent_id") String agent_id,
            @Field("wa_id") String wa_id,
            @Field("zan_num") float zan_num,
            @Field("content") String content
    );
    
    @FormUrlEncoded
    @POST("/api/appoint/comment_record")
    Observable<EvaluateEntity> evaluateList(
            @Field("access_token") String access_token
    );
    
    //我的预约-取消预约
    @GET("api/appoint/delete_appoint")
    Observable<BaseEntity> cancelAppoint(
            @Query("access_token") String access_token,
            @Query("id") String id
    );
    
    //我的预约-收款正在进行
    @GET("/api/appoint/my_paying")
    Observable<PayingEntity> paying(
            @Query("access_token") String access_token,
            @Query("sa_id") String sa_id      
    );
    
    @FormUrlEncoded
    @POST("/api/appoint/delete_paying")
    Observable<BaseEntity> deletePaying(
            @Field("access_token") String access_token,
            @Field("id") String id
    );
    
    @FormUrlEncoded
    @POST("/api/appoint/delete_history")
    Observable<BaseEntity> deleteHistory(
            @Field("access_token") String access_token,
            @Field("id") String id
    );
    
    //仓库领货 首页
    @FormUrlEncoded
    @POST("/api/depot_goods/index")
    Observable<TakeGoodsEntity> takeGoods(
            @Field("access_token") String aceess_token,
            @Field("agent_id") String id,
            @Field("cate_id") String cate_id,
            @Field("page") int page,
            @Field("wa_id") String wa_id
    );
    
    //仓库领货 领用
    @FormUrlEncoded
    @POST("/api/depot_goods/goods_info")
    Observable<GoodDetailsEntity> goodDetails(
            @Field("access_token") String access_token,
            @Field("id") String id
    );
    
    //仓库领货 规格
    @FormUrlEncoded
    @POST("/api/depot_cart/goods_info")
    Observable<GoodDetailsEntity> goodSpec(
            @Field("access_token") String access_token,
            @Field("id") String id,
            @Field("agent_id") String agent_id
    );
    
    //仓库领货 规格
    @GET("/api/depot_spec_goods_price/get_price")
    Observable<SpecEntity> spec(
            @Query("key") String key,
            @Query("goods_id") String goods_id
    );
    
    //仓库领货 加入清单
    @FormUrlEncoded
    @POST("/api/depot_cart/add_cart")
    Observable<BaseEntity> addCart(
            @Field("access_token") String access_token,
            @Field("goods_id") String goods_id,
            @Field("goods_num") String goods_num,
            @Field("item_id") String item_id,
            @Field("agent_id") String agent_id,
            @Field("wa_id") String wa_id
    );
    
    //仓库领货 清单
    @FormUrlEncoded
    @POST("/api/depot_cart/cart_list")
    Observable<CartListEntity> cartlist(
            @Field("access_token") String access_token,
            @Field("agent_id") String id,
            @Field("wa_id") String wa_id
    );
    
    //勾选单个商品
    @FormUrlEncoded
    @POST("/api/depot_cart/selected")
    Observable<CheckEntity> checkGood(
            @Field("access_token") String access_token,
            @Field("agent_id") String agent_id,
            @Field("id") String id,
            @Field("selected") String selected
    );
    
    //勾选全部 或 取消全部
    @FormUrlEncoded
    @POST("/api/depot_cart/select_all")
    Observable<CheckEntity> checkAll(
            @Field("access_token") String access_token,
            @Field("selected") String selected,
            @Field("agent_id") String agent_id
    );
    
    //仓库领货 更新商品
    @FormUrlEncoded
    @POST("/api/depot_cart/update_cart")
    Observable<BaseEntity> updateCart(
            @Field("access_token") String access_token,
            @Field("id") String id,
            @Field("agent_id") String agent_id,
            @Field("item_id") String item_id,
            @Field("goods_num") String goods_num,
            @Field("wa_id") String wa_id
    );
    
    //清单 结算
    @FormUrlEncoded
    @POST("/api/depot_cart/balance")
    Observable<BalanceEntity> jiesuan(
            @Field("access_token") String access_token,
            @Field("agent_id") String id,
            @Field("wa_id") String wa_id
    );
    
    //清单 立即结算
    @FormUrlEncoded
    @POST("/api/depot_cart/balance_right")
    Observable<BalanceEntity> lijijiesuan(
            @Field("id") String id,
            @Field("goods_id") String goods_id,
            @Field("item_id") String item_id,
            @Field("goods_num") String goods_num,
            @Field("temptime") String temptime,
            @Field("app_key") String app_key,
            @Field("sign") String sign
    );
    
    //清单 删除商品
    @FormUrlEncoded
    @POST("/api/depot_cart/delete_cart")
    Observable<BaseEntity> deleteGoods(
            @Field("access_token") String access_token,
            @Field("id") String id,
            @Field("sign") String sign,
            @Field("temptime") String temptime,
            @Field("app_key") String app_key
    );
    
    //支付
    @FormUrlEncoded
    @POST("/api/depot_order/add_order")
    Observable<AddOrderEntity> addOrder(
            @Field("access_token") String access_token,
            @Field("agent_id") String agent_id,
            @Field("wa_id") String wa_id,
            @Field("temptime") String temptime,
            @Field("app_key") String app_key,
            @Field("sign") String sign
    );
    
    //我的清单
    @FormUrlEncoded
    @POST("/api/depot_order/index")
    Observable<MyOrderEntity> myOrder(
            @Field("access_token") String access_token,
            @Field("wa_id") String wa_id,
            @Field("agent_id") String agent_id,
            @Field("status") String status,
            @Field("page") int page
    );
    
    @FormUrlEncoded
    @POST("/api/depot_order/balance_right")
    Observable<AddOrderEntity> lijijiesuanPay(
            @Field("access_token") String access_token,
            @Field("goods_id") String goods_id,
            @Field("goods_num") String goods_num,
            @Field("wa_id") String wa_id,
            @Field("item_id") String item_id,
            @Field("agent_id") String agent_id,
            @Field("temptime") String temptime,
            @Field("app_key") String app_key,
            @Field("sign") String sign
    );
    
    //我的清单 付款
    @FormUrlEncoded
    @POST("/api/depot_order/go_balance")
    Observable<AddOrderEntity> myPay(
            @Field("access_token") String access_token,
            @Field("id") String id,
            @Field("temptime") String temptime,
            @Field("app_key") String app_key,
            @Field("sign") String sign
    );
    
    //我的清单 取消订单
    @FormUrlEncoded
    @POST("/api/depot_order/cancel_order")
    Observable<BaseEntity> cancelOrder(
            @Field("access_token") String access_token,
            @Field("id") String id
    );
    
    //我的清单 删除订单
    @FormUrlEncoded
    @POST("/api/depot_order/delete_order")
    Observable<BaseEntity> deleteOrder(
            @Field("access_token") String access_token,
            @Field("id") String id
    );
    
    //我的清单 领货
    @FormUrlEncoded
    @POST("/api/depot_order/get_use_goods_info")
    Observable<TakeCodeEntity> takeCode(
            @Field("access_token") String access_token,
            @Field("id") String id
    );
    
    
    
}
